﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;


namespace MentorBackEnd.Model
{
    public class Communication
    {
        int _MenteeID;

        public int MenteeID
        {
            get { return _MenteeID; }
            set { _MenteeID = value; }
        }

        int _MentorID;

        public int MentorID
        {
            get { return _MentorID; }
            set { _MentorID = value; }
        }

        string _Message;

        public string Message
        {
            get { return _Message; }
            set { _Message = value; }
        }

        int _SenderID;

        public int SenderID
        {
            get { return _SenderID; }
            set { _SenderID = value; }
        }

        DateTime _MessageDateTime;

        public DateTime MessageDateTime
        {
            get { return _MessageDateTime; }
            set { _MessageDateTime = value; }
        }

         public Communication() { }

         public Communication(IDataReader reader) 
        {
             if (reader == null) return;

             MenteeID = (int)reader["MenteeID"];
             MentorID = (int)reader["MentorID"];
             Message = reader["Message"] != System.DBNull.Value ? (string)reader["Message"] : null;
             SenderID = (int)reader["SenderID"];
             MessageDateTime = (DateTime)reader["MessageDateTime"];
        }
    }
}